import React, { Component } from 'react';
import './App.css';
// import Header from "./Header";
import Router from "./Router";

class App extends Component {
  constructor(props){
    super(props)
    this.state = {
      fatherTitle:"我是父组件传递给子组件的标题"
    }
  }
  //创建阶段
  componentWillMount(){
    console.log("componentWillMount")
  }

  render() {
    console.log("render函数被调用")
    return (
      <div className="App">
        {/* ====>  new Header("我是父组件传递给子组件的标题") */}
        {/* <Header title={this.state.fatherTitle}/>
        <button onClick={()=>{
          this.setState({
            fatherTitle:"我是更新的标题"
          })
        }}>click</button> */}
        <Router/>
      </div>
    );
  }



  componentDidMount(){
    console.log("componentDidMount")
  }

  componentWillReceiveProps(){
    console.log("componentWillReceiveProps")
  }
  shouldComponentUpdate(){
    console.log("shouldComponentUpdate")
    return true;
  }
  componentWillUpdate(){
    console.log("componentWillUpdate")
  }
  componentDidUpdate(){
    console.log("componentDidUpdate")
  }


}

export default App;
